package com.iwhalecloud.bss.kite.cucc.spec.impl.query;

import com.iwhalecloud.bss.kite.cucc.client.api.goods.IGoodsService;
import com.iwhalecloud.bss.kite.cucc.spec.impl.transfer.GoodsInfoTransfer;
import com.iwhalecloud.bss.kite.dataservice.api.IQueryOfferEffExpConfigService;
import com.iwhalecloud.bss.kite.dataservice.entity.OfferEffExpConfig;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

@Service
public class OfferEffExpConfigQueryService implements IQueryOfferEffExpConfigService {

	@Autowired
	private IGoodsService goodsService;

	@Override
	public List<OfferEffExpConfig> listOfferEffExpConfigs(String offerId) {
		Map<String, Object> goodsInfo = goodsService.queryGoodsByOfferId(offerId);
        List<OfferEffExpConfig> configs = GoodsInfoTransfer.convertToOfferEffExp(goodsInfo);
        return configs;
	}

}
